ci: add preview smoke test for frontend PRs#7192
Open
talissoncosta wants to merge 14 commits intomainfrom
Open
ci: add preview smoke test for frontend PRs#7192talissoncosta wants to merge 14 commits intomainfrom
talissoncosta wants to merge 14 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7192 +/- ##
=======================================
Coverage 98.29% 98.29%
=======================================
Files 1351 1351
Lines 50752 50752
=======================================
Hits 49885 49885
Misses 867 867 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
89b5264 to
0c057e9
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Failures now warn instead of hard-failing individual endpoints. The job still exits non-zero so the PR check shows a warning, but continue-on-error prevents it from blocking merge. Also consolidates the 3 separate curl checks into a single endpoint loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The state and environment_url were fetched in 2 separate calls to the same endpoint. Now parsed from a single response — halves the API calls per poll iteration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0c057e9 to
06cd573
Compare
/health, /admin, /metrics and /sales-dashboard are now only reachable via internal.flagsmith.com (VPN). Public preview URLs return 404 for these paths. Keep /config/project-overrides (Express server-side route, proves the server is running) and / (proves static files are deployed). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0ab5559 to
c7492fd
Compare
Contributor
Author
|
Update: the previous approach produced false positives — it was testing URLs before Vercel finished deploying, hitting the stale previous build. Rewrote to a two-phase approach:
Also dropped |
The Deployments API approach failed for "Ignored Build Step" skips — Vercel creates no deployment for the SHA, and stores SHAs as the ref field so branch-name queries also returned nothing. Parse the preview URLs directly from the Vercel bot PR comment, which is always present and has working URLs regardless of whether a build ran. Added pull-requests:read permission for comment access. Dropped /health from the checked endpoints — now behind VPN (internal.flagsmith.com only) and returns 404 on public URLs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Apr 16, 2026
- Grep pattern widened from `flagsmith-frontend[^ )]*` to `[^ )]*vercel\.app` — resilient to project renames - Index page check now validates the response body contains 'Flagsmith', catching broken deployments that serve error pages with 200 status. Single curl call for both status + body. Closes #7262 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previous approach tested preview URLs immediately, producing false positives when Vercel was still deploying (the stale previous build responded 200). Two-phase approach: 1. Wait for Vercel deployment statuses to leave 'pending' — polls the commit status API until all Vercel-related checks complete. Handles real builds (waits for success/failure), skipped builds (immediately complete), and build failures (reports + exits). 2. Parse frontend preview URLs from the Vercel bot PR comment (now guaranteed up-to-date) and curl them with status + content validation. Trade-off: slower (waits for Vercel build, typically 2-8 min) but correct — no false positives. Contributes to #7262 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Filter statuses by 'flagsmith-frontend' instead of 'Vercel' so docs deployments don't block the wait - Poll up to 30s for the Vercel bot comment after deployments complete (handles timing gap between deploy finish and comment update) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Contributes to #7262
Vercel Preview Smoke Test
Adds a smoke test job to the frontend PR workflow. On every PR that touches
frontend/**, the job waits for Vercel to finish deploying, then verifies the preview is healthy.How it works
Phase 1 — Wait for Vercel deployments:
flagsmith-frontendchecks (scoped to frontend only — won't wait for docs)pending(real builds: waits for completion; skipped builds: immediately done)Phase 2 — Smoke test the preview:
flagsmith-frontend-*URLs from the Vercel bot PR comment (short poll with 30s buffer for comment update timing)GET /config/project-overrides— Express server is runningGET /— static files deployed + response body contains "Flagsmith" (content validation)Properties
continue-on-error: true, failures warn but don't gate mergetimeout-minutes: 15on the job,--max-time 30on each curlgh api+curlReview feedback addressed
--max-time 30)continue-on-error: true)/health(behind VPN, returns 404 on public URLs)/How did you test this code?
🤖 Generated with Claude Code